package org.example;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.example.bean.product;

@Configuration //这个类就是原来的beans.xml
public class AppConfig {
    @Bean
    public product  p1(){
        product p=new product();
        p.setId( 1 );
        p.setName( "张三" );
        p.setPrice( 100 );
        return p;
    }
}
